<template>
    <div class="add-card">
      <header class="add-header">
        <el-page-header content="告警详情" @back="$router.back()" />
      </header>
      <main class="add-main">
        <div class="form-container">
          <div class="title">告警详情</div>
          <div class="form">
            <el-form :model="form" label-width="100px">
              <el-form-item label="告警时间：" prop="warningTime">
                <p class="p1">{{ form.warningTime }}</p>
              </el-form-item>
              <el-form-item label="一体杆名称：" prop="poleName">
                <p class="p1">{{ form.poleName }}</p>
              </el-form-item>
              <el-form-item label="告警区域：" prop="areaName">
                <p class="p1">{{ form.areaName }}</p>
              </el-form-item>
              <el-form-item label="一体杆编号：" prop="poleNumber">
                <p class="p1">{{ form.poleNumber }}</p>
              </el-form-item>
              <el-form-item label="故障类型：" prop="errorType">
                <p class="p1">{{ form.errorType }}</p>
              </el-form-item>
              <el-form-item label="处置状态：" prop="handleStatus">
                <p class="p1">{{ form.handleStatus }}</p>
              </el-form-item>
            </el-form>
          </div>
        </div>
        <div class="form-container">
          <div class="title">告警处理</div>
          <div class="form">
            <el-form label-width="100px">
              <el-form-item label="处理人：" prop="handleUser">
                <p class="p1">{{ form.handleUser }}</p>
              </el-form-item>
              <el-form-item label="联系方式：" prop="phonenumber">
                <p class="p1">{{ form.phonenumber }}</p>
              </el-form-item>
              <el-form-item label="处理结果：" prop="handleResult">
                <p class="p1">{{ form.handleResult }}</p>
              </el-form-item>
              <el-form-item label="完成时间：" prop="handleTime">
                <p class="p1">{{ form.handleTime }}</p>
              </el-form-item>
            </el-form>
          </div>
        </div>
  
      </main>
    </div>
  </template>
  
  <script>
import { getwarnDetailsAPI } from '@/api/warning'
  export default {
    data(){
        return{
          // id:'',
            form:{//上表单
            },
            form2:{//下表单
              cardDate:'',//有效期 是个数组 而后端要的是两个数据
              paymentAmount:'',//支付金额
              paymentMethod:'支付宝',//支付方式
            },
        }
    },
    methods:{
      getwarnDetails(id){
      //一定是请求结束之后才会执行
      //响应回来的数据 就是res参数
      getwarnDetailsAPI(id).then((res) => {
      this.form = res.data
      // console.log(this.form)
    })
    },
    },
    mounted(){
      const id = this.$route.query.id
      this.getwarnDetails(id)
    }
  }
  </script>
  
  <style scoped lang="scss">
  .p1{
    margin: 0
  }
  .add-card {
    background-color: #f4f6f8;
    height: 100vh;
  
    .add-header {
      display: flex;
      align-items: center;
      padding: 0 20px;
      height: 64px;
      background-color: #fff;
  
      .left {
        span {
          margin-right: 4px;
        }
        .arrow{
          cursor: pointer;
        }
      }
  
      .right {
        text-align: right;
      }
    }
  
    .add-main {
      background: #f4f6f8;
      padding: 20px 130px;
  
      .form-container {
        background-color: #fff;
  
        .title {
          height: 60px;
          line-height: 60px;
          padding-left: 20px;
        }
  
        .form {
          margin-bottom: 20px;
          padding: 20px 65px 24px;
  
          .el-form {
            display: flex;
            flex-wrap: wrap;
  
            .el-form-item {
              width: 50%;
            }
          }
        }
      }
      .preview{
        img{
          width: 100px;
        }
      }
    }
  
    .add-footer {
      position: fixed;
      bottom: 0;
      width: 100%;
      padding: 24px 50px;
      color: #000000d9;
      font-size: 14px;
      background: #fff;
      text-align: center;
    }
  }
  </style>